﻿@using MakeWeekConcerts.Models
@using Microsoft.AspNet.Mvc.Facebook.Models
@using Microsoft.AspNet.Mvc.Facebook
@model MyShowPlanner
@{
    ViewBag.Title = "Details For " + Model.Show.Name;
}

<article class="intro">
    <h3>Details for concert: @Model.Show.Name</h3>
</article>

<article id="content">
    <table class="table-striped table-bordered" width="100%">
        <tr><th>Event Date/Time</th><th>Location</th><th>Location Details</th></tr>
        <tr>
            <td>@Model.Show.EventTimeStr</td>
            <td>@Model.Show.EventLocationName</td>
            <td>@((Model.Show.EventLocationDetails.Equals(Model.Show.EventLocationName, StringComparison.OrdinalIgnoreCase)) ? " " : Model.Show.EventLocationDetails)</td>
        </tr>
        @if (Model.Show.Artists.Any())
        {
            foreach (var artist in @Model.Show.Artists)
            {
            <tr>
                <td colspan="3">
                    <li class="text-info"><a target="_top" href="@GlobalFacebookConfiguration.Configuration.AppUrl@Url.Action("ArtistDetails", new { artistName = artist })">Details for @artist</a></li>
                </td>
            </tr>
            }
        }
        else
        {
            <tr>
                <td colspan="3">No artist information.</td>
            </tr>
        }
    </table>

        @if (Model.Videos.Any())
        {
            <div>
                <h4>Videos For The Bands</h4>
                <table class="table-striped table-bordered">
                    @foreach (var video in Model.Videos)
                    {
                        <tr>
                            <td><a target="_blank" href="http://www.youtube.com/watch?v=@video.Id">@Html.Raw(video.Thumbnails[0].GetHtml())</a></td>
                            <td>@video.Title</td>
                            <td>@video.Description</td>
                        </tr>
                    }
                </table>
            </div>
        }
        <div>
            <h4>Possibly Interested Friends</h4>
            @if (!Model.Friends.Any())
            {
                <div>No friends interested.</div>
            }
            else
            {
                <table class="table-striped table-bordered">
                    <tr><th>&nbsp;</th><th>Friend</th><th>Why They Might Want To Join You</th></tr>
                    @foreach (var friend in Model.Friends)
                    {
                        <tr>
                            <td><img src="@friend.Friend.Picture.Data.Url" /></td>
                            <td><a href="@friend.Friend.Link" target="_blank">@friend.Friend.Name</a></td>
                            <td>@friend.InterestedReason()</td>
                        </tr>
                    }
                </table>
            }
        </div>
</article>